﻿<script src="~/Scripts/AdminControllers/_ChurchWorkerHistoryController.js"></script>
<div class="col-md-12" ng-controller="ChurchWorkerHistoryController">
    <div class="bg-white bs-0 mb-20 widget">
        <div class="custom-grid-header">
            <div class="custom-grid-name">
                History
            </div>
            <div class="custom-grid-menu">
                <ul class="custom-grid-menu-ul pull-right">
                    <li class="custom-grid-menu-ul-li" ng-click="toggle('add','')">
                        <a href="javascript:;" class="text-white"><i class="fa fa-plus-circle"></i></a>
                    </li>
                    <li class="custom-grid-menu-ul-li dropdown">
                        <a href="javascript:;" class="dropdown-toggle text-white"><i class="zmdi zmdi-sort"></i></a>
                        <ul class="dropdown-menu dropdown-menu-right animated flipInY" style="margin-top: 4px; padding: 0px; width: 220PX;">
                            <li class="sortmenu" ng-click="sortby='DEFAULT';sort()" ng-class="{sortactive:sortby=='DEFAULT'}">
                                <div class="sort-col-1"><i class="zmdi zmdi-sort-by-alpha"></i></div>
                                <div class="sort-col-2">Default</div>
                                <div class="clearfix"></div>
                            </li>
                            <li class="sortmenu" ng-click="sortby='NAME';sort()" ng-class="{sortactive:sortby=='NAME'}">
                                <div class="sort-col-1"><i class="zmdi zmdi-sort-by-alpha"></i></div>
                                <div class="sort-col-2">Church Name</div>
                                <div class="clearfix"></div>
                            </li>
                        </ul>
                    </li>
                </ul>
                <div class="clearfix"></div>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="widget-body" style="min-height: inherit">
            <div>
                <table class="table table-striped table-bordered">
                    <thead>
                        <th style="width: 20%">Church Name</th>
                        <th style="width: 20%">Date of Taken Charge</th>
                        <th style="width: 20%">Date of Transfer</th>
                        <th style="width: 20%">Remarks</th>
                        <th style="width: 10%">Action&nbsp;</th>
                    </thead>
                    <tbody>
                        <tr ng-repeat="data in list">
                            <td>{{data.Church.ChurchName}}</td>
                            <td>{{data.DateOfTakingCharge}}</td>
                            <td>{{data.DateOfTransfer}}</td>
                            <td>{{data.Remarks}}</td>
                            <td>
                                <div class="btn-group-sm" role="group" aria-label="Second group">
                                    <button type="button" class="btn btn-info waves-effect" ng-click="toggle('edit',data.ChurchWorkerHistroyId);"><i class="fa fa-pencil"></i></button>
                                    <button type="button" class="btn btn-danger waves-effect" ng-click="delete(data.Church.ChurchName,data.ChurchWorkerHistroyId)"><i class="fa fa-trash"></i></button>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <div gridloader></div>
                <div nodata></div>
                <div class="clearfix"></div>
            </div>
            <div ng-show="list.length > 0" style="padding-right: 10px; text-align: right;">
                <div pagination="" page="currentPage" max-size="10" on-select-page="setPage(page)" boundary-links="true" total-items="filteredItems" items-per-page="entryLimit" class="pagination-small" previous-text="«" next-text="»"></div>
            </div>
        </div>
    </div>
    <div class="modal fade bs-example-modal-panel" tabindex="-1" id="ChurchWorkerHistory" role="dialog" aria-labelledby="myPanelModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header bg-primary">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myAnimationModalLabel">{{title}}</h4>
                </div>
                <form name="fromvalidate" novalidate>
                    <div class="modal-body">
                        
                        <div class="form-group">
                            <label>Church Name</label>
                            <select ng-model="Histroy.CHChurchid"
                                    ng-options="obj.CHChurchid as obj.ChurchName for obj in Churches"
                                    class="form-control" ng-required="true" name="relation"></select>
                        </div>
                        <div class="form-group">
                            <label>Date Of Taken Charge</label>
                            <input type="text" class="form-control" ng-model="Histroy.DateOfTakingCharge" calendar maxlength="100" ng-required="true">
                        </div>
                        <div class="form-group">
                            <label>Date Of Transfer</label>
                            <input type="text" class="form-control" ng-model="Histroy.DateOfTransfer" calendar maxlength="100">
                        </div>
                        <div class="form-group">
                            <label>Remarks</label>
                            <textarea class="form-control" ng-model="Histroy.Remarks" maxlength="100" ng-minlength="3"></textarea>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
                        <button type="button" class="btn btn-primary" ng-disabled="fromvalidate.$invalid || buttonstate" ng-click="save(modelstate);">Save</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
